using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using THSLib;using THSERP.BaseProvider;
using System.Data;using THSERP.BusinessEntities;using THSERP.BaseProvider;

namespace THSERP.Modules.Report
{
    public partial class ARRP003InvoicesGridControl : THSGridControl
    {
        protected override DevExpress.XtraGrid.Views.Grid.GridView InitializeGridView()
        {
            DevExpress.XtraGrid.Views.Grid.GridView gridView = base.InitializeGridView();
            
            gridView.OptionsView.ShowFooter = true;
            DevExpress.XtraGrid.Columns.GridColumn col = gridView.Columns["ARInvoiceTotalAmount"];
            col.SummaryItem.FieldName = "ARInvoiceTotalAmount";
            col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
            col.SummaryItem.DisplayFormat = "{0:n2}";

            gridView.GroupFormat = "[#image]{1} {2}";
            gridView.Columns["FK_BRBranchID"].Group();

            gridView.SortInfo.Add(new DevExpress.XtraGrid.Columns.GridColumnSortInfo(gridView.Columns["ARInvoiceDate"], DevExpress.Data.ColumnSortOrder.Descending));
            return gridView;
        }

        protected override string GetLookupTableDisplayColumn(string strLookupTableName)
        {
            if (strLookupTableName == "HREmployees")
            {
                return "HREmployeeLName";
            }
            else
                return base.GetLookupTableDisplayColumn(strLookupTableName);
        }
    }
}
